import requests 
import json  
import time

# 测试请求 定点医院机构业务办理子系统--结算明细列表接口 

def main1():

    url1="http://ld.heb.hsip.gov.cn/fms/web/queryInfo/queryDaySetlInfoPage"
    token1='58649297-f10c-45b8-b026-3fa203e6e61a'
    session1='NDIxZGMwNmQtNjgzMS00ZTYzLWJiMTQtYTk2ZmJmZGEzNGZj'


    data1={  
    'pageNum': 2,  
    'pageSize': 40,  
    'begndate': '2024-05-01 10:14:48',  # 注意这里不需要进行URL编码，requests库会自动处理  
    'enddate': '2024-05-24 10:14:48',  
    '_modulePartId_': '',  
    'frontUrl': f'http://ld.heb.hsip.gov.cn/fms/ui/W15.html#/W1502?html_no_cache={time.time()}'  
}  
    
    headers1={"Accept":"application/json, text/plain, */*",
              "Accept-Language":"zh-CN,zh;q=0.9",
              'Connection':'keep-alive',
              'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
              "Cookie":f"XSRF-TOKEN={token1}; SESSION={session1}",
              "Origin":"http://ld.heb.hsip.gov.cn",
              "Referer":"http://ld.heb.hsip.gov.cn/fms/ui/W15.html",
              "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
              "X-XSRF-TOKEN":f"{token1}"
              }
    

    resp1=requests.post(url=url1,data=data1,headers=headers1,verify=False)
    if resp1.status_code!=200 :
        print('请求失败，状态为 '+resp1.status_code)
        return
    
    txt1 = resp1.text

    print('+++++++++++++'+txt1)

if __name__ == '__main__':  
    main1()

